<?php
return array(
	
	'attributeLabels' => array(
		'create_time' => '发布时间',
		'cate_id' => '资讯分类',
		'uid' => '用户',
		'update_time'=>'修改时间',
		'cover' => '封面图',
		'description'=>'简介',
		'imageHeight'=>'图片高度',
		'imageWidth'=>'图片宽度',

	),
	
	'cascade' => array(
		'profile',
	),
	
	'rules' => array(
		array('cate_id','required'),
		array('imageHeight,imageWidth','numerical','integerOnly'=>false),
		array('cover','url'),
		array('treeParentId,cover,description,imageHeight,imageWidth', 'safe'),
	),
		
	'behaviors' => array(
		'autoUid' => array(
			'class' => 'application.components.behaviors.AutoUidBehavior',
		),
		'fornt' => array(
			'class' => 'coms.behaviors.FrontBehavior',
			'attributes' => array(
				'title' => 'title',
				'img' => 'thumb',
				'time' => array(
					'format' => 'Y-m-d',
					'attribute' => 'create_time'
				),
			),
			'route' => 'article'
		),
		'search' => array(
			'class' => 'application.behaviors.SearchBehavior',
			'noSearchAttributes' => array(
				'cate_id'
			),
			'searchModel' => 'NewsSearch',
			'timeSearch' => 'create_time'
		),
		'treeSearch' => array(
			'class' => 'coms.behaviors.TreeSearchBeahvior',
			'modelName' => 'CategoryInformation',
			'attribute' => 'cate_id',
		),
	),
	'relations' => array(
		'category'=>array(CActiveRecord::BELONGS_TO,'CategoryInformation','cate_id'),
		'profile'=>array(CActiveRecord::HAS_ONE,'NewsProfile','id'),
		'worker' => array(CActiveRecord::BELONGS_TO, 'WorkerAccount', 'uid')
	),
	
	'tableName' => 'news',
	
	'_import' => array(
		array('*', 'models.ContentBase//*'),
	),
);